/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pb138.mathml_canonicalizator;

/**
 * This is the main class of project MathML Normalization.
 * 
 * @author Richard
 */
public class MathMLNormalization {

    /**
     * This is the main method. It opens the target document (given as an
     * argument), then parses the MathML structure and normalizes it. The output
     * is a  normalized MathML file.
     * 
     * @param args the command line arguments
     */
      public static void main(String[] args){
        
        MathMLParser p = new MathMLParser();
        
          if (args.length > 0 && (args[0].equals("-g") || args[0].equals("-G"))) {
              System.out.println("Running in graphical...");
              MathMLSwing.mainGraphical(args);
          } else {
              String file = args.length > 0 ? args[0] : "/temp.xml";
              if (!file.startsWith("/")) file = "/" + file;
              
              Node n = p.parse(file, true);
              System.out.println(n);
          }
    }
}
